import WebStorage from "@/module/storage/entity/WebStorage";
import TableNameEnum from "@/enumeration/TableNameEnum";
import DbInstance from "@/plugins/DbInstance";

export default class WebStorageService {
    
    private readonly instance = new DbInstance<WebStorage>(TableNameEnum.STORAGE)

    add(record: WebStorage) {
        this.instance.save(record);
    }

    update(record: WebStorage) {
        this.instance.update(record);
    }

    list(): Array<WebStorage> {
        return this.instance.list();
    }

    info(id: string): WebStorage | null {
        return this.instance.one(id);
    }

}